/**
 * @Project : ProgrammingExercises
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q0099.java
 * @Author : WangRuoyu
 * @Date 2023/3/13 22:22
 */

package lanqiao;

import java.util.Scanner;

/**
 * @Project : ProgrammingExercises
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q0099.java
 * @Author : WangRuoyu
 * @Date 2023/3/13 22:22
 */

public class Q0099 {
    static int[][] cl;
    static int k;

    static boolean check(int mid) {
        int res = 0;
        for (int i = 0; i < cl.length; i++) {
            res += (cl[i][0] / mid) * (cl[i][1] / mid);
        }
        if (res >= k) {
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        k = scan.nextInt();
        cl = new int[n][2];

        int minSize = Integer.MIN_VALUE;

        for (int i = 0; i < n; i++) {
            cl[i][0] = scan.nextInt();
            cl[i][1] = scan.nextInt();
            minSize = Math.max(cl[i][0], minSize);
            minSize = Math.max(cl[i][1], minSize);
        }

        int l = 1;
        int r = minSize;

        while (l < r) {
            int mid = (l + r + 1) / 2;
            if (check(mid)) {
                l = mid;
            } else {
                r = mid - 1;
            }
        }
        System.out.println(l);
    }
}
//2 10
//6 5
//5 6